package com.example.myproject.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@TableName("conversations")
public class Conversation {
    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("user1_id")
    private Long user1Id;

    @TableField("user2_id")
    private Long user2Id;

    @TableField("last_message_time")
    private LocalDateTime lastMessageTime;

    @TableField("unread_count_user1")
    private Integer unreadCountUser1;

    @TableField("unread_count_user2")
    private Integer unreadCountUser2;

    @TableField(exist = false)
    private User user1;

    @TableField(exist = false)
    private User user2;
}